import React from 'react';
import { connect } from 'umi';
import App from './app'
const Test = ({dispatch, data, arr, pi}) => {
  const changeList=()=> {
    console.log(dispatch)
    // debugger
    if (dispatch) {  dispatch({
      type: 'test/fetchBasic',
     
    });

    }
  
  }
  return <div >
   <div onClick={changeList}>{data}-{arr.a}</div>
    { pi.map(item=>{
      return <div>{item.key}</div>
    })}
    <App />
  </div>
}
export default connect(({test})=>({
   data: test.list,
   arr: test.arr,
   pi: test.pi
}))(Test)